﻿Public Class frmCarnets 



    Private Sub frmCarnets_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'DbFireAndIceDataSet.tlog' table. You can move, or remove it, as needed.
        Me.TlogTableAdapter.Fill(Me.DbFireAndIceDataSet.tlog)
        'TODO: This line of code loads data into the 'DbFireAndIceDataSet.vreporteallempleados' table. You can move, or remove it, as needed.
        Me.VreporteallempleadosTableAdapter.Fill(Me.DbFireAndIceDataSet.vreporteallempleados)
        'TODO: This line of code loads data into the 'DbFireAndIceDataSet.vreporteallcarnetclientes' table. You can move, or remove it, as needed.
        Me.VreporteallcarnetclientesTableAdapter.Fill(Me.DbFireAndIceDataSet.vreporteallcarnetclientes)
        IdclienteLookUpEdit.Focus()


    End Sub

   

    Private Sub SimpleButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton2.Click

        'If IdclienteLookUpEdit.Text = "" Then

        '    ErrorProvider1.SetError(IdclienteLookUpEdit, "Seleccione un cliente")

        '    Return

        'End If

        'ErrorProvider1.SetError(IdclienteLookUpEdit, Nothing)


        Dim report As New XtraRepCarnetCliente

        'Try
        report.VreporteallcarnetclientesTableAdapter.FillByBuscaCliente(report.DbFireAndIceDataSet1.vreporteallcarnetclientes, IdclienteLookUpEdit.EditValue)
        ' report.Bands(BandKind.Detail).Controls.Add(barcode)
        report.XrLabel4.Text = "Emitido:" & Date.Today.ToString("dd/MM/yyyy") & ""
        report.ShowPreview()

        'Catch ex As Exception
        'TlogTableAdapter.InsertQueryLogs(TlogTableAdapter.ScalarQueryCountLogs + 1, My.Forms.MDI.Iduser.Caption, My.Resources.StringGlobal.prgNestor, "Pantalla frmCarnets , boton generar carnet especifico", ex.Message, My.Resources.StringGlobal.mdlClien, Date.Today, TimeOfDay.TimeOfDay.ToString, My.Computer.Name, Name.ToString, sender.GetType.FullName.ToString)
        'End Try

    End Sub

    Private Sub SimpleButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton1.Click
        Dim report As New XtraRepCarnetCliente

        report.VreporteallcarnetclientesTableAdapter.Fill(report.DbFireAndIceDataSet1.vreporteallcarnetclientes)
        ' report.Bands(BandKind.Detail).Controls.Add(barcode)


        report.XrLabel4.Text = "Emitido:" & Date.Today.ToString("dd/MM/yyyy") & ""
        report.ShowPreview()
    End Sub

   
    Private Sub SimpleButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton3.Click
        Dim report As New XtraRepImprimeCodigoBarraallCliente
        report.VreporteallcarnetclientesTableAdapter.Fill(report.DbFireAndIceDataSet1.vreporteallcarnetclientes)
        report.ShowPreview()
    End Sub

    Private Sub SimpleButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton4.Click
        Dim report As New XtraRepImprimeCodigoBarraallCliente
        report.VreporteallcarnetclientesTableAdapter.FillByBuscaCliente(report.DbFireAndIceDataSet1.vreporteallcarnetclientes, IdclienteLookUpEdit.EditValue)
        report.ShowPreview()
    End Sub
End Class